class MusicPlayer(object):
    # 定义类属性 记录单例对象引用
    instance = None

    # 重写__new__()方法
    def __new__(cls, *args, **kwargs):
        if cls.instance is None:
            # 对象引用
            cls.instance = super().__new__(cls)
        return cls.instance


player1 = MusicPlayer()
print(player1)

player2 = MusicPlayer()
print(player2)